home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / dns / dnssec.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  1KB  |  40 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. RSAMD5 = 1
  5. DH = 2
  6. DSA = 3
  7. ECC = 4
  8. INDIRECT = 252
  9. PRIVATEDNS = 253
  10. PRIVATEOID = 254
  11. _algorithm_by_text = {
  12.     'RSAMD5': RSAMD5,
  13.     'DH': DH,
  14.     'DSA': DSA,
  15.     'ECC': ECC,
  16.     'INDIRECT': INDIRECT,
  17.     'PRIVATEDNS': PRIVATEDNS,
  18.     'PRIVATEOID': PRIVATEOID }
  19. _algorithm_by_value = []([ (y, x) for x, y in _algorithm_by_text.iteritems() ])
  20.  
  21. class UnknownAlgorithm(Exception):
  22.     pass
  23.  
  24.  
  25. def algorithm_from_text(text):
  26.     value = _algorithm_by_text.get(text.upper())
  27.     if value is None:
  28.         value = int(text)
  29.     
  30.     return value
  31.  
  32.  
  33. def algorithm_to_text(value):
  34.     text = _algorithm_by_value.get(value)
  35.     if text is None:
  36.         text = str(value)
  37.     
  38.     return text
  39.  
  40.